package com.mes.pojo.oss;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;

import javax.naming.spi.InitialContextFactory;

/**
 * @Author hitsune
 * @Company kafu chino
 * @Description
 * @Time 2024/10/23 15:24
 */

public class ConstantPropertiesUtil implements InitializingBean {
    //    读取配置文件内容

    @Value("${aliyun.oss.file.endpoint}")
    private String endpoint;

    @Value("${aliyun.oss.file.keyid}")
    private String accessKeyId;

    @Value("${aliyun.oss.file.keysecret}")
    private String accessKeySecret;

    @Value("${aliyun.oss.file.bucketname}")
    private String bucketName;

    public static String END_POINT;

    public static String ACCESS_KEY_ID;

    public static String ACCESS_KEY_SECRET;

    public static String BUCKET_NAME;

    @Override
    public void afterPropertiesSet() throws Exception {
        END_POINT = endpoint;

        ACCESS_KEY_ID = accessKeyId;

        ACCESS_KEY_SECRET = accessKeySecret;

        BUCKET_NAME = bucketName;
    }
}
